package com.example.flowable.model;

import lombok.Data;
import org.flowable.engine.runtime.ProcessInstance;

import java.util.Date;

@Data
public class ProcessInstanceDTO {
    private String id;
    private String deploymentId;
    private String description;
    private String name;
    private String tenantId;
    private String businessKey;
    private String callbackId;
    private String callbackType;
    private String localizedDescription;
    private String localizedName;
    private String processDefinitionId;
    private String processDefinitionKey;
    private String processDefinitionName;
    private String processDefinitionVersion;
    private Date startTime;
    private String startUserId;
    private String processInstanceId;
    private String activityId;
    private String parentId;
    private String rootProcessInstanceId;
    private String superExecutionId;

    public ProcessInstanceDTO(ProcessInstance pi) {
        this.id = pi.getId();
        this.deploymentId = pi.getDeploymentId();
        this.description = pi.getDescription();
        this.name = pi.getName();
        this.tenantId = pi.getTenantId();
        this.businessKey = pi.getBusinessKey();
        this.callbackId = pi.getCallbackId();
        this.callbackType = pi.getCallbackType();
        this.localizedDescription = pi.getLocalizedDescription();
        this.localizedName = pi.getLocalizedName();
        this.processDefinitionId = pi.getProcessDefinitionId();
        this.processDefinitionKey = pi.getProcessDefinitionKey();
        this.processDefinitionName = pi.getProcessDefinitionName();
        this.processDefinitionVersion = pi.getProcessDefinitionId();
        this.startTime = pi.getStartTime();
        this.startUserId = pi.getStartUserId();
        this.processInstanceId = pi.getProcessInstanceId();
        this.activityId = pi.getActivityId();
        this.parentId = pi.getParentId();
        this.rootProcessInstanceId = pi.getRootProcessInstanceId();
        this.superExecutionId = pi.getSuperExecutionId();
    }

}
